package com.ybkj.daijia.server.model;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.apache.commons.lang3.StringUtils;

/**
 * @author Shine
 */
public class OrderLocation extends Base {

    /**
     *
     */
    private static final long serialVersionUID = 1L;

    private Long orderId;

    private OrderType orderType;//订单类型 代驾 专车

    private Double longitude; // 经度

    private Double latitude; // 纬度

    private Float radius;//精度

    private Float direction;//方向

    private String locType;//定位类型

    private Date locDate;//定位时间

    private Long sortId;//排序id

    private Integer run;//1在跑 0等待


    public Integer getRun() {
        return run;
    }


    public void setRun(Integer run) {
        this.run = run;
    }


    public Long getSortId() {
        return sortId;
    }


    public void setSortId(Long sortId) {
        this.sortId = sortId;
    }


    public Long getOrderId() {
        return orderId;
    }


    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }


    public OrderType getOrderType() {
        return orderType;
    }


    public void setOrderType(OrderType orderType) {
        this.orderType = orderType;
    }


    public Double getLongitude() {
        return longitude;
    }


    public void setLongitude(Double longitude) {
        this.longitude = longitude;
    }


    public Double getLatitude() {
        return latitude;
    }


    public void setLatitude(Double latitude) {
        this.latitude = latitude;
    }


    public Float getRadius() {
        return radius;
    }


    public void setRadius(Float radius) {
        this.radius = radius;
    }


    public Float getDirection() {
        return direction;
    }


    public void setDirection(Float direction) {
        this.direction = direction;
    }


    public String getLocType() {
        return locType;
    }


    public void setLocType(String locType) {
        this.locType = locType;
    }


    public Date getLocDate() {
        return locDate;
    }


    public void setLocDate(Date locDate) {
        this.locDate = locDate;
    }


    public String getLocDateStr() {
        if (null != locDate) {
            DateFormat format = new SimpleDateFormat("MM/dd HH:mm");

            return format.format(locDate);
        }
        return "未知";
    }

    public String getLocDateSecondsStr() {
        if (null != locDate) {
            DateFormat format = new SimpleDateFormat("MM/dd HH:mm:ss");

            return format.format(locDate);
        }
        return "未知";
    }

    public String getLocTypeStr() {
        if (StringUtils.isNotBlank(locType)) {
            if (locType.equals("network")) {
                return "网络定位";
            } else if (locType.equals("gps")) {
                return "GPS";
            } else if (locType.equals("wifi")) {
                return "Wifi";
            }
        }
        return "未知";
    }


    public enum OrderType {
        /**
         * 代驾
         */
        daijia,
        /**
         * 跑腿
         */
        errand,
        /**
         * 专车
         */
        zhuanche,//三个zhuanche 一般只使用这个,在行驶轨迹中,是合并后的轨迹
        zhuanche_dr, //行驶轨迹中, 司机最后上传的行驶轨迹
        zhuanche_pa, //行驶轨迹中, 乘客的行驶轨迹
        zhuanche_dr_ca, //行驶轨迹中, 司机平时上传的的行驶轨迹
        /**
         * 货运
         */
        freight,
        /**
         * 城际专线
         */
        zhuanxian,


    }


}
